(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
concat(leaf, Y) → Y
concat(cons(U, V), Y) → cons(U, concat(V, Y))
lessleaves(X, leaf) → false
lessleaves(leaf, cons(W, Z)) → true
lessleaves(cons(U, V), cons(W, Z)) → lessleaves(concat(U, V), concat(W, Z))
Rewrite Strategy: FULL
(1) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(2) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
concat(leaf, Y) → Y
concat(cons(U, V), Y) → cons(U, concat(V, Y))
lessleaves(X, leaf) → false
lessleaves(leaf, cons(W, Z)) → true
lessleaves(cons(U, V), cons(W, Z)) → lessleaves(concat(U, V), concat(W, Z))
S is empty.
Rewrite Strategy: FULL
(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(4) Obligation:
TRS:
Rules:
concat(leaf, Y) → Y
concat(cons(U, V), Y) → cons(U, concat(V, Y))
lessleaves(X, leaf) → false
lessleaves(leaf, cons(W, Z)) → true
lessleaves(cons(U, V), cons(W, Z)) → lessleaves(concat(U, V), concat(W, Z))
Types:
concat :: leaf:cons → leaf:cons → leaf:cons
leaf :: leaf:cons
cons :: leaf:cons → leaf:cons → leaf:cons
lessleaves :: leaf:cons → leaf:cons → false:true
false :: false:true
true :: false:true
hole_leaf:cons1_0 :: leaf:cons
hole_false:true2_0 :: false:true
gen_leaf:cons3_0 :: Nat → leaf:cons
(5) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
concat,
lessleavesThey will be analysed ascendingly in the following order:
concat < lessleaves
(6) Obligation:
TRS:
Rules:
concat(
leaf,
Y) →
Yconcat(
cons(
U,
V),
Y) →
cons(
U,
concat(
V,
Y))
lessleaves(
X,
leaf) →
falselessleaves(
leaf,
cons(
W,
Z)) →
truelessleaves(
cons(
U,
V),
cons(
W,
Z)) →
lessleaves(
concat(
U,
V),
concat(
W,
Z))
Types:
concat :: leaf:cons → leaf:cons → leaf:cons
leaf :: leaf:cons
cons :: leaf:cons → leaf:cons → leaf:cons
lessleaves :: leaf:cons → leaf:cons → false:true
false :: false:true
true :: false:true
hole_leaf:cons1_0 :: leaf:cons
hole_false:true2_0 :: false:true
gen_leaf:cons3_0 :: Nat → leaf:cons
Generator Equations:
gen_leaf:cons3_0(0) ⇔ leaf
gen_leaf:cons3_0(+(x, 1)) ⇔ cons(leaf, gen_leaf:cons3_0(x))
The following defined symbols remain to be analysed:
concat, lessleaves
They will be analysed ascendingly in the following order:
concat < lessleaves
(7) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
concat(
gen_leaf:cons3_0(
n5_0),
gen_leaf:cons3_0(
b)) →
gen_leaf:cons3_0(
+(
n5_0,
b)), rt ∈ Ω(1 + n5
0)
Induction Base:
concat(gen_leaf:cons3_0(0), gen_leaf:cons3_0(b)) →RΩ(1)
gen_leaf:cons3_0(b)
Induction Step:
concat(gen_leaf:cons3_0(+(n5_0, 1)), gen_leaf:cons3_0(b)) →RΩ(1)
cons(leaf, concat(gen_leaf:cons3_0(n5_0), gen_leaf:cons3_0(b))) →IH
cons(leaf, gen_leaf:cons3_0(+(b, c6_0)))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(8) Complex Obligation (BEST)
(9) Obligation:
TRS:
Rules:
concat(
leaf,
Y) →
Yconcat(
cons(
U,
V),
Y) →
cons(
U,
concat(
V,
Y))
lessleaves(
X,
leaf) →
falselessleaves(
leaf,
cons(
W,
Z)) →
truelessleaves(
cons(
U,
V),
cons(
W,
Z)) →
lessleaves(
concat(
U,
V),
concat(
W,
Z))
Types:
concat :: leaf:cons → leaf:cons → leaf:cons
leaf :: leaf:cons
cons :: leaf:cons → leaf:cons → leaf:cons
lessleaves :: leaf:cons → leaf:cons → false:true
false :: false:true
true :: false:true
hole_leaf:cons1_0 :: leaf:cons
hole_false:true2_0 :: false:true
gen_leaf:cons3_0 :: Nat → leaf:cons
Lemmas:
concat(gen_leaf:cons3_0(n5_0), gen_leaf:cons3_0(b)) → gen_leaf:cons3_0(+(n5_0, b)), rt ∈ Ω(1 + n50)
Generator Equations:
gen_leaf:cons3_0(0) ⇔ leaf
gen_leaf:cons3_0(+(x, 1)) ⇔ cons(leaf, gen_leaf:cons3_0(x))
The following defined symbols remain to be analysed:
lessleaves
(10) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
lessleaves(
gen_leaf:cons3_0(
n440_0),
gen_leaf:cons3_0(
n440_0)) →
false, rt ∈ Ω(1 + n440
0)
Induction Base:
lessleaves(gen_leaf:cons3_0(0), gen_leaf:cons3_0(0)) →RΩ(1)
false
Induction Step:
lessleaves(gen_leaf:cons3_0(+(n440_0, 1)), gen_leaf:cons3_0(+(n440_0, 1))) →RΩ(1)
lessleaves(concat(leaf, gen_leaf:cons3_0(n440_0)), concat(leaf, gen_leaf:cons3_0(n440_0))) →LΩ(1)
lessleaves(gen_leaf:cons3_0(+(0, n440_0)), concat(leaf, gen_leaf:cons3_0(n440_0))) →LΩ(1)
lessleaves(gen_leaf:cons3_0(n440_0), gen_leaf:cons3_0(+(0, n440_0))) →IH
false
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(11) Complex Obligation (BEST)
(12) Obligation:
TRS:
Rules:
concat(
leaf,
Y) →
Yconcat(
cons(
U,
V),
Y) →
cons(
U,
concat(
V,
Y))
lessleaves(
X,
leaf) →
falselessleaves(
leaf,
cons(
W,
Z)) →
truelessleaves(
cons(
U,
V),
cons(
W,
Z)) →
lessleaves(
concat(
U,
V),
concat(
W,
Z))
Types:
concat :: leaf:cons → leaf:cons → leaf:cons
leaf :: leaf:cons
cons :: leaf:cons → leaf:cons → leaf:cons
lessleaves :: leaf:cons → leaf:cons → false:true
false :: false:true
true :: false:true
hole_leaf:cons1_0 :: leaf:cons
hole_false:true2_0 :: false:true
gen_leaf:cons3_0 :: Nat → leaf:cons
Lemmas:
concat(gen_leaf:cons3_0(n5_0), gen_leaf:cons3_0(b)) → gen_leaf:cons3_0(+(n5_0, b)), rt ∈ Ω(1 + n50)
lessleaves(gen_leaf:cons3_0(n440_0), gen_leaf:cons3_0(n440_0)) → false, rt ∈ Ω(1 + n4400)
Generator Equations:
gen_leaf:cons3_0(0) ⇔ leaf
gen_leaf:cons3_0(+(x, 1)) ⇔ cons(leaf, gen_leaf:cons3_0(x))
No more defined symbols left to analyse.
(13) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
concat(gen_leaf:cons3_0(n5_0), gen_leaf:cons3_0(b)) → gen_leaf:cons3_0(+(n5_0, b)), rt ∈ Ω(1 + n50)
(14) BOUNDS(n^1, INF)
(15) Obligation:
TRS:
Rules:
concat(
leaf,
Y) →
Yconcat(
cons(
U,
V),
Y) →
cons(
U,
concat(
V,
Y))
lessleaves(
X,
leaf) →
falselessleaves(
leaf,
cons(
W,
Z)) →
truelessleaves(
cons(
U,
V),
cons(
W,
Z)) →
lessleaves(
concat(
U,
V),
concat(
W,
Z))
Types:
concat :: leaf:cons → leaf:cons → leaf:cons
leaf :: leaf:cons
cons :: leaf:cons → leaf:cons → leaf:cons
lessleaves :: leaf:cons → leaf:cons → false:true
false :: false:true
true :: false:true
hole_leaf:cons1_0 :: leaf:cons
hole_false:true2_0 :: false:true
gen_leaf:cons3_0 :: Nat → leaf:cons
Lemmas:
concat(gen_leaf:cons3_0(n5_0), gen_leaf:cons3_0(b)) → gen_leaf:cons3_0(+(n5_0, b)), rt ∈ Ω(1 + n50)
lessleaves(gen_leaf:cons3_0(n440_0), gen_leaf:cons3_0(n440_0)) → false, rt ∈ Ω(1 + n4400)
Generator Equations:
gen_leaf:cons3_0(0) ⇔ leaf
gen_leaf:cons3_0(+(x, 1)) ⇔ cons(leaf, gen_leaf:cons3_0(x))
No more defined symbols left to analyse.
(16) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
concat(gen_leaf:cons3_0(n5_0), gen_leaf:cons3_0(b)) → gen_leaf:cons3_0(+(n5_0, b)), rt ∈ Ω(1 + n50)
(17) BOUNDS(n^1, INF)
(18) Obligation:
TRS:
Rules:
concat(
leaf,
Y) →
Yconcat(
cons(
U,
V),
Y) →
cons(
U,
concat(
V,
Y))
lessleaves(
X,
leaf) →
falselessleaves(
leaf,
cons(
W,
Z)) →
truelessleaves(
cons(
U,
V),
cons(
W,
Z)) →
lessleaves(
concat(
U,
V),
concat(
W,
Z))
Types:
concat :: leaf:cons → leaf:cons → leaf:cons
leaf :: leaf:cons
cons :: leaf:cons → leaf:cons → leaf:cons
lessleaves :: leaf:cons → leaf:cons → false:true
false :: false:true
true :: false:true
hole_leaf:cons1_0 :: leaf:cons
hole_false:true2_0 :: false:true
gen_leaf:cons3_0 :: Nat → leaf:cons
Lemmas:
concat(gen_leaf:cons3_0(n5_0), gen_leaf:cons3_0(b)) → gen_leaf:cons3_0(+(n5_0, b)), rt ∈ Ω(1 + n50)
Generator Equations:
gen_leaf:cons3_0(0) ⇔ leaf
gen_leaf:cons3_0(+(x, 1)) ⇔ cons(leaf, gen_leaf:cons3_0(x))
No more defined symbols left to analyse.
(19) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
concat(gen_leaf:cons3_0(n5_0), gen_leaf:cons3_0(b)) → gen_leaf:cons3_0(+(n5_0, b)), rt ∈ Ω(1 + n50)
(20) BOUNDS(n^1, INF)